﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;

/// <summary>
///WebConfig 的摘要说明
/// </summary>
public class WebConfig
{
	public WebConfig()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    public static bool IsDebug()
    {
        bool r = false;
        try
        {
            string debug = XDocument.Load(HttpContext.Current.Server.MapPath("~/web.config")).Elements().First().Elements().First(x => x.Name == "system.web").Elements().First(y => y.Name == "compilation").Attribute("debug").Value;
            bool.TryParse(debug, out r);
        }
        catch (Exception ex)
        { }
        return r;
    }
}
